from typing import Dict
from collections import namedtuple

from faker import Faker

FakerStrategy = namedtuple('FakerStruct', 'title generate')

faker_engine: Faker = Faker("zh_CN")

strategy_map: Dict[str, FakerStrategy] = {}

strategy_map["personName"] = FakerStrategy("人名", (lambda *args, **kwargs: (
    faker_engine.name()
)))

strategy_map["buildingNumber"] = FakerStrategy("楼号", (lambda *args, **kwargs: (
    faker_engine.building_number()
)))

strategy_map["countryName"] = FakerStrategy("国家名", (lambda *args, **kwargs: (
    faker_engine.country()
)))

strategy_map["city"] = FakerStrategy("城市名(带市县)", (lambda *args, **kwargs: (
    faker_engine.city()
)))

strategy_map["longitude"] = FakerStrategy("经度", (lambda *args, **kwargs: (
    faker_engine.longitude()
)))

strategy_map["latitude"] = FakerStrategy("经度", (lambda *args, **kwargs: (
    faker_engine.latitude()
)))


if __name__ == '__main__':
    print(list(strategy_map.keys()))
    print(strategy_map["countryName"].generate())